package com.zhehekeji.opsys.api.webservice.server;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing;

import com.zhehekeji.opsys.api.resp.CheckRegisterResp;
import com.zhehekeji.opsys.api.resp.UserOrderResp;
import com.zhehekeji.opsys.api.resp.UserRegisterResp;
import com.zhehekeji.opsys.api.resp.UserUpdateResp;

/**
 * @ClassName UserManager
 * @Description 用户管理接口
 * @author chenweiliu chenwei.liu@163.com
 * @date 2015-4-13   下午3:51:08
 */
@Path(value="/")
@WebService
@CrossOriginResourceSharing(allowAllOrigins=true)
public interface UserManager {
	
	@GET
	@Path(value="userOrder")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doUserOrder",operationName="userOrder")
    UserOrderResp order(@WebParam(name="productCode")@QueryParam(value="productCode")String productCode,
                        @WebParam(name="point")@QueryParam(value="point")Integer point,
                        @WebParam(name="userID")@QueryParam(value="userID")String userID,
                        @WebParam(name="cpCode")@QueryParam(value="cpCode")Long cpCode);
	
	@GET
	@Path(value="register")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doRegister",operationName="register")
    UserRegisterResp register(@WebParam(name="userID")@QueryParam(value="userID")String userID,
                              @WebParam(name="userName")@QueryParam(value="userName")String userName,
                              @WebParam(name="mobileNo")@QueryParam(value="mobileNo")String mobileNo,
                              @WebParam(name="cpCode")@QueryParam(value="cpCode")Long cpCode);
	
	@GET
	@Path(value="checkRegister")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doCheckRegister",operationName="checkRegister")
	CheckRegisterResp checkRegister(@WebParam(name="userID")@QueryParam(value="userID")String userID,
			@WebParam(name="cpCode")@QueryParam(value="cpCode")Long cpCode);
	
	@GET
	@Path(value="update")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doUpdate",operationName="update")
    UserUpdateResp update(@WebParam(name="userID")@QueryParam(value="userID")String userID,
                          @WebParam(name="userName")@QueryParam(value="userName")String userName,
                          @WebParam(name="mobileNo")@QueryParam(value="mobileNo")String mobileNo,
                          @WebParam(name="cpCode")@QueryParam(value="cpCode")Long cpCode);
}
